package org.mtdownload.app.loader;
/*
 * Created on 30-Jan-2005
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
import java.io.IOException;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLStreamHandler;

/**
 * This is the protocol that knows to search through a given class file (it knows everything about it
 * apriori), of my type, and find a requested resource.
 * The URL format :
 * protocol= classrunner
 * file = <name of the resource> 
 * @author sergiu
 */
public class JarClassLoaderStreamHandler extends URLStreamHandler {

	/* (non-Javadoc)
	 * @see java.net.URLStreamHandler#openConnection(java.net.URL)
	 */
	protected URLConnection openConnection(URL u) throws IOException {
		System.out.println("procotol:"+u.getProtocol());
		System.out.println("host:"+u.getHost());
		System.out.println("file:"+u.getFile());
		return new JarClassLoaderConnection(u);
	}

}
